The present application relates to processing pieces of artwork in a computer-graphics illustration.
Computer-graphics illustrations are typically made up of a set of artwork elements, such as images, line art, text, or overprinted objects. These artwork elements are typically handled as individual entities, allowing a designer to edit the illustration by moving and modifying the artwork elements after they have been added to the illustration. The artwork elements are typically arranged in a sequence or stack that defines the relative positions of each artwork element with respect to a viewer of the illustration. Artwork elements that are higher up in the sequence are conceptually closer to the viewer, such that if they intersect artwork elements that are lower down in the sequence, the upper element overlaps, and at least partially covers, the lower element.
When a source computer program outputs a computer-graphics illustration to a target, for example another program or a device such as a printer, it can be necessary to process the illustration to remove or transform artwork elements, or their associated properties, that are not compatible with the target. Such artwork elements are typically processed in order to generate representations of them that the target can handle.
As an illustrative example, some computer graphics programs and output devices do not recognize some types of transparency. For this reason, it is sometimes necessary to process transparent artwork to prepare it for output to a target program or device—in particular, when outputting an image containing transparency to a printer. In this context, a transparent artwork element is an element through at least some portion of which it is possible to see underlying elements to at least some degree; an artwork element does not have to be completely transparent to be considered a transparent artwork element. Thus, the appearance of a transparent artwork element is affected by what lies beneath it (without considering the effect of any artwork elements that overlap the transparent element).
Transparent artwork elements containing a type of transparency that the target cannot handle are called, for the purposes of this example, incompatibly transparent artwork elements. In this example, transparent artwork elements that do not contain any type of transparency that the target cannot handle are called compatibly transparent artwork elements. One way of dealing with transparency when preparing an illustration for output to a target that cannot handle some types of transparency is to flatten the incompatibly transparent artwork elements and the elements that they overlap. Flattening is a type of transformation in which artwork elements are merged together into new or modified artwork elements when the interaction between the original elements cannot be accurately represented by the target.
In one prior approach, a flattening program uses an off-screen low-resolution grid to identify artwork elements to be included in a planar map for subsequent flattening. The low-resolution grid allows the program to quickly determine which artwork elements may be overlapped by incompatibly transparent artwork elements. The grid has the same outer boundaries as the image, but uses a relatively small number of grid cells to speed processing. In such an approach, to flatten an illustration the flattening program iterates in reverse paint order through the artwork elements in a computer graphics illustration. If the current artwork element is incompatibly transparent, the flattening program marks each of the cells that it touches in the low-resolution grid and flags the artwork element as being involved in transparency. If the artwork element is not incompatibly transparent, the flattening program determines whether any of the grid cells that it touches are already marked in the low-resolution grid. If so, the flattening program flags the artwork element as being involved in transparency. If in this case the artwork element also happens to be compatibly transparent, the flattening program marks the grid cells that it touches in the low-resolution grid as well. After it has iterated through all of the artwork elements in the illustration, the flattening program adds all of the artwork elements that have been flagged as being involved in transparency to a planar map that maintains the spatial relationships between the included elements, and divides the planar map into non-overlapping flattening regions. If a compatibly transparent artwork element is overlapped by an incompatibly transparent artwork element, it must be added to the planar map. Any artwork elements that this compatibly transparent artwork element overlaps are also added to the planar map, regardless of whether they are overlapped by an incompatibly transparent artwork element. A flattened appearance can then be determined for each flattening region, such that a single non-transparent artwork element with that flattened appearance would closely approximate the appearance of the original collection of overlapping artwork elements in the flattening region. Artwork elements that were included in the planar map are not sent to the target; only the flattened representations of them are sent.
This flattening method can spread the effects of flattening transparency beyond the regions where incompatible transparency is actually present. For example, PostScript® printers are able to process and represent overprinted artwork elements. However, overprinted artwork elements are typically treated as compatibly transparent artwork elements. Therefore, if an opaque artwork element is overlapped by an overprinted artwork element that is in turn overlapped by an incompatibly transparent artwork element that does not overlap the opaque artwork element, all three artwork elements are flattened, even though the target printer could have handled the opaque artwork element without flattening it.